package com.zhouxiaoge.类加载器;

import java.lang.reflect.Method;

public class Main {
    public static void main(String[] args) throws Exception {
        while (true) {
            FileClassLoader fileClassLoader = new FileClassLoader();
            fileClassLoader.setFileName("C:\\Users\\zmy\\IdeaProjects\\Java_8\\basics\\target\\classes\\com\\zhouxiaoge\\类加载器/SayHello.class");
            Object obj = null;
            obj = fileClassLoader.loadClass("com.zhouxiaoge.类加载器.SayHello").newInstance();
            Method m = obj.getClass().getMethod("say", new Class[]{});
            m.invoke(obj, new Object[]{});
            Thread.sleep(2000);
        }
    }
}